<template>
  <div class="show-area-item">
    <div class="show-area-item__info-container">
      <img :src="imgSrc" class="object-fit-cover show-area-item__image" />
      <div class="flex-grow-1">
        <div class="show-area-item__title">{{ title }}</div>
        <div class="show-area-item__tag-container">
          <Tag
            class="tag"
            :key="item + index"
            v-for="(item, index) in tagTextList"
            :text="item"
            :colorIndex="index"
          ></Tag>
        </div>
      </div>
      <div class="d-flex flex-column align-items-end">
        <LineThroughPrice v-if="linePrice" class="line-price" :text="linePrice"></LineThroughPrice>
        <div class="d-flex">
          <DiscountTag v-if="discountText" :text="discountText" />
          <div class="show-area-item__price">{{ price }}</div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import Tag from "/src/components/Tag.vue";
import DiscountTag from "/src/components/DiscountTag.vue";
import LineThroughPrice from "/src/components/LineThroughPrice.vue";

defineProps({
  imgSrc: { type: String, required: true },
  title: { type: String, required: true },
  tagTextList: { type: Array, required: true },
  price: { type: String, required: true },
  linePrice: String,
  discountText: String,
});
</script>

<style>
.show-area-item {
  height: 168px;
  display: flex;
  flex: 1;
  justify-content: space-between;
  align-items: center;
  padding-right: 40px;
}
.show-area-item:hover {
  background: #19192f;
  transition: background 0.3s;
}
.show-area-item__info-container {
  flex: 1;
  display: flex;
  align-items: center;
}
.show-area-item__image {
  width: 168px;
  height: 168px;
  margin-right: 40px;
}
.show-area-item__title,
.show-area-item__price {
  margin-left: 2rem;
  color: #fff;
  font-size: 32px;
  font-weight: 700;
  flex-shrink: 0;
}
.show-area-item__tag-container {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}
.line-price {
  margin-bottom: 10px;
}

@media screen and (min-width: 1280px) {
  .show-area-item__price {
    margin-left: 3rem;
  }
}
</style>
